package com.example.nbshopping.utils;

import android.content.Context;

import java.io.File;

public class URLUtils {
    //内网公共部分
    //public static final String PUBLIC_URL = "http://192.168.13.34:8080/beikeMarket";
    //外网公共部分，担心共发流量问题以及数据无厘头
    public static final String PUBLIC_URL = "http://47.100.26.130:8085/beikeMarket";


    /*用户相关*/
    //1.注册接口
    public static String register_url = PUBLIC_URL + "/user/register";
    //2.登录接口
    public static String login_url = PUBLIC_URL + "/user/login";
    //3.更新完善个人信息
    public static String updateInfo_url = PUBLIC_URL + "/user/updateInfo";
    //4.显示密保问题
    public static String showQuestion_url = PUBLIC_URL + "/user/showQuestion";
    //5.验证密保答案
    public static String verifyAnswer_url = PUBLIC_URL + "/user/verifyAnswer";
    //6.修改密码
    public static String updatePwd_url = PUBLIC_URL + "/user/updatePwd";

    public static String historyCart_url = PUBLIC_URL + "trade/querybougth";

    //    http://192.168.13.143:8080/beikeMarket/biz/queryAllCategory
    /* 业务相关*/
    //1.查询所有分类
    public static String queryAllCategory_url = PUBLIC_URL + "/biz/queryAllCategory";
    //2.通过分类查询
    public static String queryCommodityByCateId_url = PUBLIC_URL + "/biz/queryCommodityByCateId?categoryId=";
    //3.根据商品名模糊查询
    public static String queryCommodityByName_url = PUBLIC_URL + "/biz/queryCommodityByName?name=";
    //4.商品详情
    public static String queryCommodityInfo_url = PUBLIC_URL + "/biz/queryCommodityInfo?commodityId=";
    //5.热销产品
    public static String hotCommodity_url = PUBLIC_URL + "/biz/hotCommodity?code=";
    //6.产品推荐
    public static String recommendCommodity_url = PUBLIC_URL + "/biz/recommendCommodity?code=";
    //7.猜你喜欢
    public static String guessYouLike_url = PUBLIC_URL + "/biz/guessYouLike?code=";

    /*购物车相关*/
    public static String insertShoppingCar_url = PUBLIC_URL + "/trade/queryShoppingCar";

    public static String getImgPath(Context context, String name) {
        String path = context.getExternalCacheDir()//SD卡的缓存路径
                + File.separator + name + ".jpg";
        return path;
    }
}
